package com.wt.test.ai.springai.controller;

import com.wt.test.ai.springai.manager.ImageManager;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 *  图片处理控制器
 * @author qiyu
 * @since 2025/2/6
 */
@RestController
@RequestMapping("/image")
@RequiredArgsConstructor
@Slf4j
public class ImageController {

    private final ImageManager imageManager;
    
    @GetMapping("/generate")
    public String generate(@RequestParam("imageContent") String imageContent) {
        log.info("receive imageContent: {}", imageContent);
        return imageManager.generateImage(imageContent);
    }
}
